const {
	updateTestServerUrl,
	saveTestHeader,
} = require('./api-test-methods')

module.exports = function(apiComp) {
	let {
		testServerUrlComp,
		testHeaderDialog,
		testHeaderText,
		alertDialog,
		alertText,
	} = apiComp

	testServerUrlComp.textbox({
		label: '测试服务器地址:',
		icons: [{
			iconCls: 'icon-reload',
			handler: function(e) {
				updateTestServerUrl.call(apiComp, e)
			}
		}]
	})

	testHeaderDialog.dialog({
		title: '测试header',
		top: 100,
		left: 300,
		width: 800,
		height: 460,
		closed: true,
		modal: true,
		buttons: [{
			text: '保存',
			iconCls: 'icon-save',
			handler: function() {
				saveTestHeader.call(apiComp)
			}
		}, {
			text: '取消',
			iconCls: 'icon-cancel',
			handler: function() {
				testHeaderDialog.dialog('close')
			}
		}]
	})

	testHeaderText.textbox({
		multiline: true,
	})

	alertDialog.dialog({
		title: '提示',
		top: 100,
		left: 300,
		width: 800,
		height: 460,
		closed: true,
		modal: true,
	})
	alertText.textbox({
		multiline: true,
		editable: false,
		cls: 'font-size:50px;',
	})

	// textbox内容字体大小
	// $("#_easyui_textbox_input26").css({
	// 	'font-size': '20px'
	// })
}